Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <head> <script src="http://maps.googleapis.com/maps/api/js"> </script> <script> var map; var myCenter=new google.maps.LatLng(45.434046,12.340284); function initialize() { var mapProp = { center:myCenter, zoom:18, mapTypeId:google.maps.MapTypeId.HYBRID }; map=new google.maps.Map(document.getElementById("googleMap"),mapProp); } google.maps.event.addDomListener(window, 'load', initialize); </script> </head> <body> <button onclick="alert(map.getHeading());">Drag the compass wheel and get heading/degrees</button> <br><br> <div id="googleMap" style="width:500px;height:380px;"></div> </body> <!-- Mirrored from www.w3schools.com/googleAPI/tryit.asp?filename=tryhtml_ref_getheading by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:08:42 GMT --> </html>
Result:
Try it Yourself - © w3schools.com